package cn.itcast.beans;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import cn.itcast.beans2.DemoBeans2;
import cn.itcast.config.AppContext;

@RunWith(SpringRunner.class)
@ContextConfiguration(classes = {AppContext.class})
public class DemoAppConfigBeans2 {
	
	//自动装配
	@Autowired
	DemoBeans2 demo;
	
	@Test
	public void test() {
		demo.run();
	}
	
	@Test
	public void test1() {
		
		DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
		
		Date date = new Date();
		
		System.out.println(dateFormat.format(date));
		
	}
}
